package com.mori.design.pattern.builder;

/**
 * 学生类，具体创建对象的执行者
 *
 * @author mori
 */
public class Student {


    /**
     * 写作文,传入不同的builder，总是根据相同的过程构造对象
     *
     * @return {@link String}
     */
    public String writeComposition(CompositionBuilder builder) {
        String title = builder.writeTitle();
        String theBeginning = builder.writeTheBeginning();
        String content = builder.writeContent();
        String theEnd = builder.writeTheEnd();
        return title + "\n" + theBeginning + "\n" + content + "\n" + theEnd;
    }

}
